package com.example.yichuangyun.mvvm.di.retrofit;

import com.example.yichuangyun.http.ApiFactory;
import com.example.yichuangyun.model.StatusModel;
import com.example.yichuangyun.model.UserInfoModel;
import com.example.yichuangyun.model.business.LabelModel;
import com.example.yichuangyun.model.call.CallRecordTransModel;
import com.example.yichuangyun.model.company.AreaModel;
import com.example.yichuangyun.model.company.CollectDataModel;
import com.example.yichuangyun.model.company.CompanyDataModel;
import com.example.yichuangyun.model.company.CompanyDetailsContactsDataModel;
import com.example.yichuangyun.model.company.CustomInfoDataModel;
import com.example.yichuangyun.model.company.GsBaseInfoModel;
import com.example.yichuangyun.model.company.GsChangeRecordDataModel;
import com.example.yichuangyun.model.company.IntellectualPropertyDataModel;
import com.example.yichuangyun.model.company.ManageInfoDataModel;
import com.example.yichuangyun.model.company.OutsideInvestDataModel;
import com.example.yichuangyun.model.company.RiskInfoDataModel;
import com.example.yichuangyun.model.contacts.AddContactsParamsModel;
import com.example.yichuangyun.model.contacts.AddressDataModel;
import com.example.yichuangyun.model.contacts.ContactsBusinessDataModel;
import com.example.yichuangyun.model.contacts.ContactsTagModel;
import com.example.yichuangyun.model.order.BusinessRecordModel;
import com.example.yichuangyun.model.order.DefPackageModel;
import com.example.yichuangyun.model.order.DefPriceModel;
import com.example.yichuangyun.model.order.FileInfoDataModel;
import com.example.yichuangyun.model.order.FileTypeModel;
import com.example.yichuangyun.model.order.IncomePayDataModel;
import com.example.yichuangyun.model.order.InvoiceDataModel;
import com.example.yichuangyun.model.order.OrderFollowDataModel;
import com.example.yichuangyun.model.order.OrderListDataModel;
import com.example.yichuangyun.model.order.SelectOrderInfoDataModel;
import com.example.yichuangyun.model.order.ServiceRecordModel;
import com.example.yichuangyun.model.order.VisitRecordsModel;
import com.example.yichuangyun.utils.treelist.SetShareBean;

import java.util.List;

import io.reactivex.Flowable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiConstants {

    /**
     * 获取联系人列表
     */
    @POST(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/getContactInfoList")
    Flowable<BaseModel<AddressDataModel>> getContactsList(@Body RequestBody requestBody);

    @Multipart
    @POST(ApiFactory.BASE_SERVER + "/api/call/record/upload")
    Flowable<BaseModel<String>> uploadImage(@Part MultipartBody.Part image_part);

    @Multipart
    @POST(ApiFactory.PC_SERVER + "/api/file")
    Flowable<StatusModel> uploadImage2(@Part MultipartBody.Part image_part);

    /**
     * 获取组织架构
     */
    @POST(ApiFactory.BASE_SERVER + "/login-part/serv/user/getOrgTree")
    Flowable<SetShareBean> getTreeData(@Body RequestBody requestBody);

    /**
     * 获取标签
     */
    @POST(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/getContractLabels")
    Flowable<BaseModel<List<ContactsTagModel>>> getTags(@Body RequestBody requestBody);

    /**
     * 联系人来源
     */
    @POST(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/getSources")
    Flowable<BaseModel<List<LabelModel>>> getContactsSource();

    /**
     * 联系人类型
     */
    @POST(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/getButtonList")
    Flowable<BaseModel<List<LabelModel>>> getContactsType();

    /**
     * 新增联系人信息
     */
    @POST(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/saveContractInfo")
    Flowable<BaseModel<String>> saveContractInfo(@Body RequestBody requestBody);

    /**
     * 编辑联系人信息
     */
    @POST(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/updateContactInfo")
    Flowable<BaseModel<String>> editContractInfo(@Body RequestBody requestBody);

    /**
     * 查询历史标签 -- 用户所有
     */
    @GET(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/listLabelForUser/{contactId}")
    Flowable<BaseModel<List<ContactsTagModel>>> getUserAllTags(@Path("contactId") int contactId);

    /**
     * 删除历史标签
     */
    @GET(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/deleteLabelForContact/{labelId}")
    Flowable<BaseModel<String>> deleteTag(@Path("labelId") String labelId);

    /**
     * 删除历史标签 -- 用户所有
     */
    @POST(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/deleteLabelForAll")
    Flowable<BaseModel<String>> deleteAllTag(@Body RequestBody requestBody);

    /**
     * 查询联系人 -- 商机记录
     */
    @GET(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/listBusinessInfo/{contactId}/{page}/{pageSize}/")
    Flowable<BaseModel<ContactsBusinessDataModel>> getContactsBusinessList(@Path("contactId") String contactId, @Path("page") int page, @Path("pageSize") int pageSize, @Query("examine") int examine);

    /**
     * 联系人详情
     */
    @GET(ApiFactory.BASE_SERVER + "/api/crm/app/t-contact-info/getContractInfo/{contactId}/")
    Flowable<BaseModel<AddContactsParamsModel>> getContactsDetails(@Path("contactId") String contactId, @Query("id") String id, @Query("examine") int examine);

    /**
     * 获取所有区域
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/registrationDistrict/selectPart")
    Flowable<BaseModel<List<AreaModel>>> getAreaList();

    /**
     * 获取企业列表
     */
    @POST(ApiFactory.COMPANY_URL + "/api/enterprise/ext/list")
    Flowable<BaseModel<CompanyDataModel>> getCompanyList(@Body RequestBody requestBody);

    /**
     * 获取官方企业基本信息
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/getById/{eid}")
    Flowable<BaseModel<CompanyDataModel.CompanyModel>> getOfficialBaseInfoDetail(@Path("eid") String eid);

    /**
     * 获取详情企业联系方式
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/baseInfo/getTelsByEid/")
    Flowable<BaseModel<CompanyDetailsContactsDataModel>> getDetailsContacts(@Query("eid") String eid);

    /**
     * 工商信息
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/basicInfo/{eid}")
    Flowable<BaseModel<GsBaseInfoModel>> getGsBaseInfo(@Path("eid") String eid);

    /**
     * 工商变更记录
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/basicInfo/changeRecord/{eid}")
    Flowable<BaseModel<GsChangeRecordDataModel>> getGsChangeRecord(@Path("eid") String eid, @Query("page") int page, @Query("pageSize") int pageSize);

    /**
     * 风险信息
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/risk/{eid}")
    Flowable<BaseModel<RiskInfoDataModel>> getRiskInfo(@Path("eid") String eid);

    /**
     * 经营信息
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/management/{eid}")
    Flowable<BaseModel<ManageInfoDataModel>> getManageInfo(@Path("eid") String eid);

    /**
     * 产权证书
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/property/{eid}")
    Flowable<BaseModel<IntellectualPropertyDataModel>> getIntellectualProperty(@Path("eid") String eid);

    /**
     * 对外投资
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/investment/{eid}")
    Flowable<BaseModel<List<OutsideInvestDataModel.OutsideInvestModel>>> getInvestment(@Path("eid") String eid);

    /**
     * 收藏企业
     */
    @POST(ApiFactory.COMPANY_URL + "/api/enterprise/ext/company/saveCollect")
    Flowable<BaseModel<String>> collectCompany(@Body RequestBody requestBody);

    /**
     * 取消收藏企业
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/company/cancelCollect/{eid}")
    Flowable<BaseModel<String>> cancelCollectCompany(@Path("eid") String eid);

    /**
     * 获取可拨打电话
     */
    @GET(ApiFactory.COMPANY_URL + "/api/enterprise/ext/tels/{eid}")
    Flowable<BaseModel<List<CompanyDetailsContactsDataModel.ContactsModel>>> getContacts(@Path("eid") String eid, @Query("eid") String eidd);

    /**
     * 获取我的收藏
     */
    @POST(ApiFactory.COMPANY_URL + "/api/enterprise/ext/company/findEnterpriseCollectList")
    Flowable<BaseModel<CollectDataModel>> getMyCollectList(@Body RequestBody requestBody);

    /**
     * 取消我的收藏
     */
    @POST(ApiFactory.COMPANY_URL + "/api/enterprise/ext/company/delCollect")
    Flowable<BaseModel<String>> delCollectCompany(@Body RequestBody requestBody);

    /**
     * 完善企业信息
     */
    @POST(ApiFactory.COMPANY_URL + "/api/enterprise/autonomousInfo/save")
    Flowable<BaseModel<String>> saveCompanyInfo(@Body RequestBody requestBody);

    /**
     * 多图上传
     */
    @Multipart
    @POST(ApiFactory.BASE_SERVER + "/api/enterprise/autonomousInfo/uploadFileList")
//    @POST(ApiFactory.BASE_SERVER + "/api/enterprise/autonomousInfo/list")
    Flowable<BaseModel<List<String>>> uploadImage(@Part MultipartBody.Part[] fileList);

    /**
     * 自主信息列表
     */
    @POST(ApiFactory.COMPANY_URL + "/api/enterprise/autonomousInfo/list")
    Flowable<BaseModel<CustomInfoDataModel>> getCustomList(@Body RequestBody requestBody);

    /**
     * 获取订单信息
     */
    @POST(ApiFactory.PC_SERVER + "/crmapi/business/selectOrderInfo")
    Flowable<BaseModel<SelectOrderInfoDataModel>> selectOrderInfo(@Body RequestBody requestBody);

    /**
     * 获取订单列表
     */
    @GET(ApiFactory.PC_SERVER + "/api/serv/order/getOrderLists")
    Flowable<BaseModel<OrderListDataModel>> getOrderList(@Query("current") int current, @Query("size") int size,
                                                         @Query("keyValue") String keyValue, @Query("renewalState") Integer renewalState,
                                                         @Query("promotionId") String promotionId, @Query("userId") String userId,
                                                         @Query("isDept") Integer isDept, @Query("orderStatus") Integer orderStatus,
                                                         @Query("type") Integer type, @Query("startTime") String startTime, @Query("endTime") String endTime,
                                                         @Query("moneyConfirmStatus") Integer moneyConfirmStatus, @Query("serviceCategory") Integer serviceCategory);

    /**
     * 款项确认
     */
    @POST(ApiFactory.PC_SERVER + "/api/serv/order/moneyConfirm")
    Flowable<BaseModel<String>> moneyConfirm(@Body RequestBody requestBody);

    /**
     * 获取订单详情
     */
    @GET(ApiFactory.PC_SERVER + "/api/serv/order/getOrderDetail")
    Flowable<BaseModel<OrderListDataModel.OrderRecordsModel>> getOrderDetails(@Query("id") String id);

    /**
     * 获取订单-服务
     */
    @GET(ApiFactory.PC_SERVER + "/api/service-track/{id}/order")
    Flowable<BaseModel<ServiceRecordModel>> getOrderDetailsForService(@Path("id") String id, @Query("size") int size);

    /**
     * 获取订单-商机
     */
    @POST(ApiFactory.PC_SERVER + "/api/oper-bo/customer/listRelaChance")
    Flowable<BaseModel<BusinessRecordModel>> getOrderDetailsForBusiness(@Body RequestBody requestBody);

    /**
     * 订单详情-订单和服务跟进
     */
    @GET(ApiFactory.PC_SERVER + "/api/service-track/{id}/record-order")
    Flowable<BaseModel<OrderFollowDataModel>> getOrderDetailsForOrderFollow(@Path("id") String id);

    /**
     * 获取订单-客户回访
     */
    @POST(ApiFactory.PC_SERVER + "/api/oper-bo/customer/otherSourceList")
    Flowable<BaseModel<VisitRecordsModel>> getOrderDetailsForVisit(@Body RequestBody requestBody);

    /**
     * 订单详情-文件信息
     */
    @POST(ApiFactory.PC_SERVER + "/api/service-track-ath/listOrderFile")
    Flowable<BaseModel<FileInfoDataModel>> getOrderDetailsForFileInfo(@Body RequestBody requestBody);

    /**
     * 订单详情-发票记录
     */
    @GET(ApiFactory.PC_SERVER + "/invoiceapi/finance-invoice/order/finance")
    Flowable<BaseModel<InvoiceDataModel>> getOrderDetailsForInvoice(@Query("orderId") String orderId,
                                                                    @Query("current") int current,
                                                                    @Query("size") int size,
                                                                    @Query("type") int type);


    /**
     * 订单详情-收支记录
     */
    @GET(ApiFactory.PC_SERVER + "/api/serv/orderEnter/subOrderInfoByServiceId?sourceOrderSort=1&current=1&size=50")
    Flowable<BaseModel<IncomePayDataModel>> getOrderDetailsForIncomePay(@Query("orderId") String orderId);

    /**
     * 添加跟进-获取附件类型
     */
    @GET(ApiFactory.PC_SERVER + "/api/serv/attachment/getAttachmentTypes")
    Flowable<List<FileTypeModel>> getFileType();

    /**
     * 添加跟进-获取附件类型
     */
    @POST(ApiFactory.PC_SERVER + "/api/service-track/track-order")
    Flowable<StatusModel> addOrderFollow(@Body RequestBody requestBody);

    /**
     * 修改头像
     */
    @POST(ApiFactory.PC_SERVER + "/login-part/serv/user/editThumbAvatar")
    Flowable<BaseModel<String>> editThumbAvatar(@Body RequestBody requestBody);

    /**
     * 获取个人信息
     */
    @POST(ApiFactory.PC_SERVER + "/api/sys-commission/getUserInfo")
    Flowable<BaseModel<UserInfoModel>> getUserInfo(@Body RequestBody requestBody);

    /**
     * 获取默认套餐
     */
    @GET(ApiFactory.PC_SERVER + "/operation/api/operation/product-info/select/product/getDefaultPriceResp/{id}")
    Flowable<BaseModel<List<DefPackageModel>>> getDefaultPriceResp(@Path("id") String id);

    /**
     * 判断有无套餐，获取价格
     */
    @POST(ApiFactory.PC_SERVER + "/operation/api/operation/product-info/app/check/product")
    Flowable<BaseModel<DefPriceModel>> getPrice(@Body RequestBody requestBody);

    /**
     * 生成订单
     */
    @POST(ApiFactory.PC_SERVER + "/crmapi/business/createOrder")
    Flowable<BaseModel<String>> createOrder(@Body RequestBody requestBody);

    /**
     * 管帮手录音文件
     */
    @POST(ApiFactory.BASE_SERVER + "/api/call/record/findByName/")
    Flowable<BaseModel<String>> getRecordUrl(@Body RequestBody requestBody);

    /**
     * 获取录音文件
     */
    @POST(ApiFactory.PC_SERVER + "/crmapi/record/downLoad")
    Flowable<BaseModel<String>> getPcRecordUrl(@Body RequestBody requestBody);

    /**
     * 录音文件转文字
     */
    @POST(ApiFactory.PC_SERVER + "/crmapi/track/trackTranscription")
    Flowable<BaseModel<CallRecordTransModel>> getTranscription(@Body RequestBody requestBody);

    /**
     * 获取企业的eid
     */
    @POST(ApiFactory.PC_SERVER + "/crmapi/business/selectOdsEnterpriseByCompanyName")
    Flowable<BaseModel<CompanyDataModel.CompanyModel>> getEid(@Body RequestBody requestBody);
}
